package testCasalib 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import org.casalib.display.CasaMovieClip;
	import org.casalib.display.CasaShape;
	import org.casalib.display.CasaSimpleButton;
	/**
	 * ...
	 * @author ...
	 */
	public class __simplebutton extends Sprite
	{
		private var __sb:CasaSimpleButton;
		
		public function __simplebutton() 
		{
			trace(this);
			var __upState:CasaShape = new CasaShape;
			__upState.graphics.beginFill(0x000000);
			__upState.graphics.drawRect(0, 0, 80, 50);
			__upState.graphics.endFill();
			
			var __overState:CasaShape = new CasaShape;
			__overState.graphics.beginFill(0x004080);
			__overState.graphics.drawRect(0, 0, 80, 50);
			__overState.graphics.endFill();
			
			var __downState:CasaShape = new CasaShape;
			__downState.graphics.beginFill(0x808080);
			__downState.graphics.drawRect(0, 0, 80, 50);
			__downState.graphics.endFill();
			
			var __hitTestState:CasaShape = new CasaShape;
			__hitTestState.graphics.beginFill(0x808080);
			__hitTestState.graphics.drawRect(0, 0, 120, 80);
			__hitTestState.graphics.endFill();
			
			__sb = new CasaSimpleButton(__upState, __overState, __downState, __hitTestState);
			__sb.x = stage.stageWidth / 2;
			__sb.y = stage.stageHeight / 2;
			__sb.addEventListener(MouseEvent.CLICK, _onMouseClick);
			addChild(__sb);
		}
		
		private function _onMouseClick(e:MouseEvent):void 
		{
			trace(this, "on mouse click");
		}
		
	}

}